<% form_for @usuario, :html => {:class => "tabular",:multipart => true},  :builder => UniformBuilder do |f| %>
  <%= f.error_messages %>
  <div class="box">
    <%= tabs "paneles", @modulos %>
    <div id="paneles">
      <% @modulos.each do |modulo| %>
        <%= render :partial => "modulo_#{modulo.nombref}",:locals=>{:modulo=>modulo,:f=>f} %>
      <% end %>
    </div>
  </div>
  <%= f.submit "Guardar" %>
<% end %>
<% content_for :sidebar do -%>
  <h3>Foto</h3>
  <div>
    <%= image_tag @usuario.foto.url(),:id=>"avatar_#{@usuario.id}"%>
  </div>
<% end %>
<script type="text/javascript">
  function makeColorBox(){
  $('.colorbox').colorbox({transition:"fade",maxWidth:"90%",maxHeight:"90%"});
  }

  $(document).ready(function(){
  $("#avatar_<%=@usuario.id%>").dblclick(function(){
  $("input[name=usuario[foto]]").trigger('click');
  });
  makeColorBox();
  })
</script>